PICTools Programmer's Reference
PIC2List JPEG2000 Metadata Packets Functions

The JPEG2000 Metadata Packets include packets for handling UUID Boxes, UUID Info Boxes, XML Boxes, and IPTC Data. The IPTC packets are discussed in their own section (see PIC2List IPTCDataSet Packet Functions).

UUID Boxes

The P2PktUUIDBox structure is defined as:

 
Copy Code
typedef struct {
   BYTE     Type;
   DWORD    Length;
   BYTE     UUID[16];
   DWORD    DataLength;
   BYTE     Data[1]
} P2PktUUIDBox;

Name Description

Type

Set to P2P_UUIDBox to indicate that this packet contains a UUID Box.

Length

The total length of this packet in bytes.

UUID

The 16 byte UUID for this box.

DataLength

The length of the Data field in bytes.  A DataLength of zero indicates an empty UUID box.

Data    

The data for the UUID box.

P2LAddUUIDBox

 
Copy Code

P2PktUUIDBox *P2LAddUUIDBox(P2LIST* p2l, BYTE *UUID, DWORD length, const BYTE* data);

P2LAddUUIDBox adds a UUIDBox packet of the specified characteristics, enlarging the PIC2List if necessary.  If Data is a null pointer, then the Data field in the UUID Box is set to 0.  If length is zero then an empty UUID box is added. P2LAddUUIDBox will return a 0 if a memory allocation error occurs while attempting to enlarge the PIC2List.

P2LDeleteUUIDBox

 
Copy Code

BOOL P2LDeleteUUIDBox(P2LIST* p2l, P2PktUUIDBox* pkt);

P2LDeleteUUIDBox is called to delete a UUID Box packet from the PIC2List.  Pkt must point to the Type field of a P2PktUUIDBox packet within the PIC2List.  No validation is performed.

P2LFirstUUIDBox

 
Copy Code

P2PktUUIDBox *P2LFirstUUIDBox(const P2LIST* p2l);

P2LFirstUUIDBox will return a pointer to the first UUID Box packet.  P2LFirstUUIDBox will return a 0 if there are no UUID Box packets in the PIC2List.

P2LNextUUIDBox

 
Copy Code

P2PktUUIDBox *P2LNextUUIDBox(const P2LIST* p2l, P2PktUUIDBox* pkt);

P2LNextUUIDBox will return a pointer to the first UUID Box packet following pkt.  Pkt must point into the PIC2List to the Type field of an UUID Box packet.  No validation is performed.  If 0 is returned, then there is no UUID Box packet following the packet in the PIC2List.

P2LFindUUIDBox

 
Copy Code

P2PktUUIDBox* P2LFindUUIDBox(const P2LIST* p2l, BYTE *UUID);

P2LFindUUIDBox finds the first UUID Box packet in the list with pkt->UUID equal to UUID.  P2LFindUUIDBox will return a 0 if there is no matching UUID Box packet in the PIC2List.

P2LFindNextUUIDBox

 
Copy Code

P2PktUUIDBox* P2LFindNextUUIDBox(const P2LIST* p2l, P2PktUUIDBox* pkt);

P2LFindNexUUIDBox will return a pointer to the first UUID Box packet following pkt with matching UUID of pkt->UUID.  Pkt must point into the PIC2List to the Type field of an UUID Box packet.  No validation is performed.  If 0 is returned, then there is no matching UUID Box packet following the packet in the PIC2List.

UUID Info Boxes

The P2PktUUIDDataEntryURL structure is defined as:

 
Copy Code
typedef struct {
   BYTE     Type;
   DWORD    Length;
   BYTE     ID;       // Reserved, Must always be zero
   BYTE     Vers;     // always 0
   DWORD    Flag;     // always 0
   BYTE     UUID[16];
   char     URL[1]; // Always NULL terminated
} P2PktUUIDDataEntryURL;

Name Description

Type

Set to P2P_UUIDDataEntryURL to indicate that this packet contains a UUID Data Entry URL.

Length

The total length of this packet in bytes.

ID

Reserved, must always be zero.

Vers

The Vers field from the UUID Data Entry URL box must always be zero.  It will always be zero when returned from an opcode.

Flag

The Flag field from the UUID Data Entry URL box must always be zero.  It will always be zero when returned from an opcode.

UUID

The 16 byte UUID for this Data Entry URL.

URL

A NULL terminated UTF-8 string.

P2LAddUUIDDataEntryURL

 
Copy Code

P2PktUUIDDataEntryURL *P2LAddUUIDDataEntryURL(P2LIST* p2l, BYTE *UUID, BYTE ID, BYTE Vers,                                           DWORD Flag, const char* URL);

P2LAddUUIDDataEntryURL adds a UUIDDataEntryURL packet of the specified characteristics, enlarging the PIC2List if necessary.  ID, Vers, and Flag are all reserved and should be set to 0.  P2LAddUUIDBox will return a 0 if a memory allocation error occurs while attempting to enlarge the PIC2List.

P2LDeleteUUIDDataEntryURL

 
Copy Code

BOOL P2LDeleteUUIDDataEntryURL(P2LIST* p2l, P2PktUUIDDataEntryURL * pkt);

P2LDeleteUUIDDataEntryURL is called to delete a UUID Data Entry URL packet from the PIC2List.  Pkt must point to the Type field of a P2PktUUIDDataEntryURL packet within the PIC2List.  No validation is performed.

P2LFirstUUIDDataEntryURL

 
Copy Code

P2PktUUIDDataEntryURL *P2LFirstUUIDDataEntryURL(const P2LIST* p2l);

P2LFirstUUIDDataEntryURL will return a pointer to the first UUID Data Entry URL packet.  P2LFirstUUIDDataEntryURL will return a 0 if there are no UUID Data Entry URL packets in the PIC2List.

P2LNextUUIDDataEntryURL

 
Copy Code

P2PktUUIDDataEntryURL *P2LNextUUIDDataEntryURL(const P2LIST* p2l, P2PktUUIDDataEntryURL * pkt);

P2LNextUUIDDataEntryURL will return a pointer to the first UUID Data Entry URL packet following pkt.  Pkt must point into the PIC2List to the Type field of an UUID Data Entry URL packet.  No validation is performed.  If 0 is returned, then there is no UUID Data Entry URL packet following the packet in the PIC2List.

P2LFindUUIDDataEntryURL

 
Copy Code

P2PktUUIDDataEntryURL * P2LFindUUIDDataEntryURL(const P2LIST* p2l, BYTE *UUID, const char *URL, int method);

P2LFindUUIDDataEntryURL finds the first UUID Data Entry URL in the list based on method.  If method is P2FIND_UUIDDATAENTRYURL_BY_UUID then it will return the first packet in the list with pkt->UUID equal to UUID.  If method is P2FIND_UUIDDATAENTRYURL_BY_URL then it will return the first packet in the list with pkt->URL equal to URL. P2LFindUUIDDataEntryURL will return a 0 if there is no matching UUID Data Entry URL packet in the PIC2List.

P2LFindNextUUIDDataEntryURL

 
Copy Code

P2PktUUIDDataEntryURL * P2LFindNextUUIDDataEntryURL(const P2LIST* p2l, P2PktUUIDDataEntryURL * pkt, int method);

P2LFindNexUUIDDataEntryURL will return a pointer to the next UUID Data Entry URL in the list based on method.  If method is P2FIND_UUIDDATAENTRYURL_BY_UUID then it will return the next packet in the list with the UUID at pkt->UUID equal to the UUID at ptr.  If method is P2FIND_UUIDDATAENTRYURL_BY_URL then it will return the next packet in the list with the URL at pkt->URL equal to the URL at ptr.  Pkt must point into the PIC2List to the Type field of an UUID Data Entry URL packet.  No validation is performed.  If 0 is returned, then there is no matching UUID Data Entry URL packet following the packet in the PIC2List.

XML Boxes

The P2PktXMLBox structure is defined as

 
Copy Code
typedef struct {
   BYTE    Type;
   DWORD   Length;
   char    XML[1]; // Always NULL terminated
} P2PktXMLBox;

Name Description

Type

Set to P2P_XMLBox to indicate that this packet contains an XML Box.

Length

The total length of this packet in bytes.

XML

The XML data for this XML Box.  It must always be NULL terminated.  If the data is UTF-16 it must start with a Byte Order Marker (BOM) and be doubly NULL terminated.

P2LAddXMLBox

 
Copy Code

P2PktXMLBox *P2LAddXMLBox(P2LIST* p2l, const char* XML);

P2LAddXMLBox adds a XML Box packet of the specified characteristics, enlarging the PIC2List if necessary.  The XML data must be NULL terminated.  If it is UTF-16 data then it must begin with a Byte Order Marker (BOM) and then be terminated by two NULLs.  If it is UTF-8 data then it must be terminated with a single NULL.  P2LAddXMLBox will return a 0 if a memory allocation error occurs while attempting to enlarge the PIC2List.

P2LDeleteXMLBox

 
Copy Code

BOOL P2LDeleteXMLBox(P2LIST* p2l, P2PktXMLBox* pkt);

P2LDeleteXMLBox is called to delete a XML Box packet from the PIC2List.  Pkt must point to the Type field of a P2PktXMLBox packet within the PIC2List.  No validation is performed.

P2LFirstXMLBox

 
Copy Code

P2PktXMLBox *P2LFirstXMLBox(const P2LIST* p2l);

P2LFirstXMLBox will return a pointer to the first XML Box packet.  P2LFirstXMLBox will return a 0 if there are no XML Box packets in the PIC2List.

P2LNextXMLBox

 
Copy Code

P2PktXMLBox *P2LNextXMLBox(const P2LIST* p2l, P2PktXMLBox* pkt);

P2LNextXMLBox will return a pointer to the first XML Box packet following pkt.  Pkt must point into the PIC2List to the Type field of an XML Box packet.  No validation is performed.  If 0 is returned, then there is no XML Box packet following the packet in the PIC2List.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback